class Solution:
    def getWinner(self, arr: list, k: int) -> int:
        if k >= len(arr):
            return max(arr)
        winner = arr[0]
        win = 0
        for num in arr[1:]:
            if winner > num:
                win += 1
            else:
                winner = num
                win = 1
            if win == k:
                break

        return winner
